<template>
    <div>
        <van-row>
            <Hearders />
            <Left />
            <van-col span="12">
                <van-uploader :after-read="afterRead"  icon="plus" type="primary" />导入&ensp;&ensp;
                <button @click="daochu">导出</button>
            </van-col>
        
        </van-row>


    </div>
</template>

<script>
import Hearders from '../comm/hearders'
import Left from '../comm/left.vue'
import { ref } from 'vue';
import axios from '../../http/axios'
// import axios from 'axios'

export default {
components: { Hearders ,Left}, 
    setup(){
        const fileList = ref([]);
        //导入
        const afterRead=(file)=>{
            let formdata = new FormData()
            formdata.append('file',file.file)
            // axios({url:'/comany/daoru/',method:'post',data:formdata}).then(res=>{
            //     console.log(res)
            // })
            axios('/comany/daoru/','post',formdata).then(res=>{
                console.log(res)
                console.log(file)
            })
        }
        //导出
        const daochu=()=>{
            axios('/comany/daochu/','get').then(res=>{
                console.log(res)
            })
        },
        
        return{
            fileList,
            afterRead,
            daochu
        }
    }
    }
</script>

<style scoped>

</style>